@extends('admin.layout')
@section('content')
@section('title',$title)
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                {{$title}}
                <small>更快的管理您的订单信息
                    @if(session('info'))
                        <span id="info" class="text-red">{{session('info')}}</span>
                    @endif
                </small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{url('/admin/index')}}"><i class="fa fa-dashboard"></i> Home</a></li>
                <li><a href="{{url('/admin/category/create')}}"></a></li>
                <li class="active">订单列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">快速查看订单列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                            <table id="example2" class="table table-bordered table-hover">
                            
                               <form action="{{url('/admin/order/index')}}">
                                   <div class="row">
                                        <div class="col-md-2">
                                           <div class="form-group">
                                                <select name="num" class="form-control">
                                                    <option
                                                    @if(!empty($request['num']) && $request['num'] == 10) selected="selected"
                                                    @endif>10</option>
                                                    <option
                                                    @if(!empty($request['num']) && $request['num'] == 20) selected="selected"
                                                    @endif>20</option>
                                                    <option
                                                    @if(!empty($request['num']) && $request['num'] == 50) selected="selected"
                                                    @endif>50</option>
                                                    <option
                                                    @if(!empty($request['num']) && $request['num'] == 100) selected="selected"
                                                    @endif>100</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-4 col-md-offset-6" >
                                            <div class="input-group input-group-sm">
                                               <input name="keywords"
                                                value="{{$request['keywords']  or  ''}}" type="text" class="form-control" placeholder="请输入要查询信息的手机号">
                                               <span class="input-group-btn">
                                              <button class="btn btn-info btn-flat" type="submit">搜索</button>
                                              </span>
                                            </div><!-- /input-group -->
                                        </div>
                                   </div>

                               </form>
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>用户名</th>
                                    <th>收货人</th>
                                    <th>收货地址</th>
                                    <th>电话</th>
                                    <th>订单状态</th>
                                    <th>买家留言</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>                                @foreach( $data as $row)
                                <tr>
                                    <td>{{$row -> id}}</td>
                                    <td class='td_name'>{{$row -> uid}}</td>
                                    <td>{{$row -> rec}}</td>
                                    <td>{{$row -> addr}}</td>
                                    <td>{{$row -> tel}}</td>
                                    <td>{{$row -> status}}</td>
                                    <td>{{$row -> umsg}}</td>
                                    <td>
                                        <a  href="{{ url('/admin/order') }}/detail/{{$row -> id}}">订单详情</a>
                                        <a  onclick="return confirm('确认要删除吗?');" href="{{ url('/admin/order') }}/delete/{{$row -> id}}">删除订单</a>

                                        @if($row -> status == '未发货')
                                        <a  onclick="return confirm('确认要发货吗?');" href="{{ url('/admin/order') }}/send/{{$row -> id}}">发货</a>
                                        @endif
                                    </td>
                                </tr>
                                @endforeach
                                </tfoot>
                            </table>
                            {{ $data -> appends($request) -> links() }}
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->

    //点击修改信息
    <script>

        window.onload = function()
        {         

            $('#info').fadeOut(1000);  
        }

    </script>
@endsection